<template>
	<view class="mycopy">
		<div class="mycopy_top">
			<image src="../../static/img/bg_02.png" alt="" class="mycopy_top_img" />
			<image src="../../static/img/bg_03.png" alt="" class="mycopy_top_img" />
		</div>
		<div class="mycopy_my">
			<div class="mycopy_my_left">
				<image :src="nan.avatar?nan.avatar:this.fileList2" alt=""
					style="width: 70px; height: 70px; border-radius: 40px;margin-right: 30px;" />
				<div class="mycopy_my_left_right">
					<div>{{nan.nickName}}</div>
					<div style="margin-top: 5px;">{{nan.createTime}}</div>
				</div>
			</div>
			<div class="mycopy_my_right">
				<image src="../../static/img/m_05.png" alt="" style="width: 30px; height: 30px;" @click="thismy" />
			</div>
		</div>
		<div class="mycopy_con">
			<div class="mycopy_con_1">
				<div class="mycopy_con_left">
					<div class="mycopy_con_left_1">{{myasc.total}}</div>
					<div>累计回收</div>
				</div>
				<div class="mycopy_con_left">
					<div class="mycopy_con_left_1">{{myasc.num}}</div>
					<div>回收</div>
				</div>
			</div>
			<div class="mycopy_con_2" v-if="nan.recyclerType == 1" @click="huishou">
				<div class="mycopy_con_2_img">
					<image src="@/static/img/me_05.png" alt="" style="width: 30px; height: 30px;" />
					回收设置
				</div>
				<div class="mycopy_con_2_right">></div>
			</div>
			<div class="mycopy_con_2" @click="aaaaa">
				<div class="mycopy_con_2_img">
					<image src="@/static/img/me_08.png" alt="" style="width: 30px; height: 30px;" />
					回收记录
				</div>
				<div class="mycopy_con_2_right">></div>
			</div>
		</div>
		<bottom-tab url='/pages/my/mycopy'></bottom-tab>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				myasc: {},
				nan: '',
				fileList2: '../../static/img/logo.png',
			}
		},
		onLoad() {
			this.$ajax('get', 'recovery/user/profile').then((res) => {
				this.myasc = res.data
				this.nan = res.data.user
			})
		},
		methods: {
			huishou() {
				uni.navigateTo({
					url: '../index/Reclaimsetting'
				})
			},
			aaaaa() {
				console.log(1);
				if (this.nan.recyclerType === 1) {
					uni.navigateTo({
						url: '../index/Recallslip'
					})
				} else {
					uni.navigateTo({
						url: '../index/RecallslipSa'
					})
				}
			},
			thismy() {
				uni.navigateTo({
					url: '../my/my'
				})
			},
			qingchu() {
				uni.removeStorage({
					key: 'key',
					success: function() {
						console.log('缓存已删除');
					},
					fail: function(err) {
						console.error('删除缓存失败', err);
					}
				});
			}
		}
	}
</script>

<style scoped>
	page {
		background-color: #f1f1f1;
	}

	.mycopy_my_left {
		display: flex;
		align-items: center;
	}

	.mycopy_my_left img {
		border-radius: 50px;
	}

	.mycopy_my_right {
		display: flex;
		align-items: center;
	}

	.mycopy_my_left_right {}

	.mycopy_top {
		position: relative;
		background-color: #fff;
		height: 200px;
		border-bottom-left-radius: 10px;
		border-bottom-right-radius: 10px;
	}

	.mycopy_my {
		display: flex;
		justify-content: space-between;
		position: absolute;
		top: 50px;
		padding: 0 20px;
		align-items: center;
		width: 90%;
	}

	.mycopy_top_img {
		width: 100%;
	}

	.mycopy_con {
		position: absolute;
		top: 170px;
		width: 90%;
		padding: 0 20px;
	}

	.mycopy_con_1 {
		padding: 20px 0;
		border-radius: 10px;
		display: flex;
		justify-content: space-around;
		background-color: #fff;
		border: 1px solid #ccc;
	}

	.mycopy_con_left {
		display: flex;
		align-items: center;
		flex-direction: column;
	}

	.mycopy_con_left_1 {
		font-size: 20px;
	}

	.mycopy_con_2 {
		display: flex;
		justify-content: space-between;
		padding: 20px 20px;
		background-color: #fff;
		margin-top: 20px;
		border-radius: 10px;
	}

	.mycopy_con_2_img {
		display: flex;
		align-items: center;
	}

	.mycopy_con_2_right {
		font-size: 25px
	}
</style>